package com.alienlab.finder.domain;


import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import javax.validation.constraints.*;

import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * A Warning.
 */
@Entity
@Table(name = "warning")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Warning implements Serializable {

    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @NotNull
    @Column(name = "admin_open_id", nullable = false)
    private String adminOpenId;

    @NotNull
    @Column(name = "guest_open_id", nullable = false)
    private String guestOpenId;

    @Column(name = "description")
    private String description;

    @Column(name = "jhi_time")
    private ZonedDateTime time;

    @Column(name = "readflag")
    private String readflag;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAdminOpenId() {
        return adminOpenId;
    }

    public Warning adminOpenId(String adminOpenId) {
        this.adminOpenId = adminOpenId;
        return this;
    }

    public void setAdminOpenId(String adminOpenId) {
        this.adminOpenId = adminOpenId;
    }

    public String getGuestOpenId() {
        return guestOpenId;
    }

    public Warning guestOpenId(String guestOpenId) {
        this.guestOpenId = guestOpenId;
        return this;
    }

    public void setGuestOpenId(String guestOpenId) {
        this.guestOpenId = guestOpenId;
    }

    public String getDescription() {
        return description;
    }

    public Warning description(String description) {
        this.description = description;
        return this;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public ZonedDateTime getTime() {
        return time;
    }

    public Warning time(ZonedDateTime time) {
        this.time = time;
        return this;
    }

    public void setTime(ZonedDateTime time) {
        this.time = time;
    }

    public String getReadflag() {
        return readflag;
    }

    public void setReadflag(String readflag) {
        this.readflag = readflag;
    }

    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Warning warning = (Warning) o;
        return Objects.equals(id, warning.id) &&
            Objects.equals(adminOpenId, warning.adminOpenId) &&
            Objects.equals(guestOpenId, warning.guestOpenId) &&
            Objects.equals(description, warning.description) &&
            Objects.equals(time, warning.time) &&
            Objects.equals(readflag, warning.readflag);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, adminOpenId, guestOpenId, description, time, readflag);
    }

    @Override
    public String toString() {
        return "Warning{" +
            "id=" + id +
            ", adminOpenId='" + adminOpenId + '\'' +
            ", guestOpenId='" + guestOpenId + '\'' +
            ", description='" + description + '\'' +
            ", time=" + time +
            ", readflag='" + readflag + '\'' +
            '}';
    }
}
